/*
 * <<
 *  Davinci
 *  ==
 *  Copyright (C) 2016 - 2019 EDP
 *  ==
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *        http://www.apache.org/licenses/LICENSE-2.0
 *   Unless required by applicable law or agreed to in writing, software
 *   distributed under the License is distributed on an "AS IS" BASIS,
 *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *   See the License for the specific language governing permissions and
 *   limitations under the License.
 *  >>
 *
 */

package com.sdkj.dspservice.modules.report.service;

import com.sdkj.dspservice.common.base.service.CrudService;
import com.sdkj.dspservice.modules.report.entity.Source;
import com.sdkj.dspservice.modules.report.entity.tem.TableInfo;

import java.sql.SQLException;
import java.util.List;

/**
 * 数据源service
 *
 * @author tm
 */
public interface SourceService extends CrudService<Source> {

    /**
     * 测试数据源
     *
     * @param source
     * @return
     */
    boolean testSource(Source source) throws SQLException;
    /**
     * 获取数据库列表
     * @param id
     * @return
     */
    List<String> getDatabaseNameList(String id);
    /**
     * 获取数据表名称列表
     * @param id
     * @return
     */
    List<String> getTableNameList(String id);

    /**
     * 获取表结构
     * @param id
     * @param tableName 表名
     * @return
     */
    TableInfo getTableInfo(String id, String tableName);
}
